package PSQueue;

import java.util.ArrayList;
/**
 * @author cyye
 *
 */
public class PSSubscription implements AbstractSubscription {
	private ArrayList<String> ids;
	private String condition = "true"; //by default

	public PSSubscription() {
		ids = new ArrayList<String>();
	}
	
	/*public void setIds(ArrayList<String> ids) {
		this.ids = ids;
	}*/

	public ArrayList<String> getIds() {
		return ids;
	}
	
	public void addID(String id) {
		assert id!=null;
		if(!ids.contains(id))
		  ids.add(id);
	}
	
	public void addIDS(ArrayList<String> idlist) {
		assert idlist!=null;
		ids.removeAll(idlist);
		ids.addAll(idlist);
	}

	public void setCondition(String condition) {
		assert condition!=null;
		assert !"".equals(condition);
		this.condition = condition;
	}

	public String getCondition() {
		return condition;
	}
}
